<script>
function abc(){
 var name=document.getElementById('search_key');
 name.className="ipt12";
}
function cc(x){
 var name=document.getElementById("con_five_"+x);
 var list=document.getElementById("five"+x);
 name.style.display="none";
 list.className="";
}
function setTab(name,cursel,n){
 for(i=1;i<=n;i++){
  var menu=document.getElementById(name+i);
  var con=document.getElementById("con_"+name+"_"+i);
  menu.className=i==cursel?"hover":"";
  con.style.display=i==cursel?"block":"none";
 }
}

</script>
<!--302页面-->
  <div class="main">
     <div class="left">
         <?php @include_component("system","menuNavigator",array("catalogId"=>$catalogId,"subCatalogId"=>$subCatalogId,"type"=>2,"cssStr"=>"address_tit address_tit301"));?>
         <div class="sub_nav sub_nav302">
           <ul>
           <?php
              echo "<li ".(1008==$subCatalogId?"class='now'":"").">".link_to('音乐',"video/list?catalogId=".$catalogId."&subCatalogId=1008",'')."<p></p></li>"
           ."<li ".(1006==$subCatalogId?" class='now'":"").">".link_to('电影',"video/list?catalogId=".$catalogId."&subCatalogId=1006",'')."<p></p></li>"
           ."<li ".(1007==$subCatalogId?" class='now'":"").">".link_to('电视',"video/list?catalogId=".$catalogId."&subCatalogId=1007",'')."<p></p></li>"
           ."<li ".(1009==$subCatalogId?" class='now'":"").">".link_to('综艺',"video/list?catalogId=".$catalogId."&subCatalogId=1009",'')."<p></p></li>"
           ."<li ".(1010==$subCatalogId?" class='now'":"").">".link_to('独家',"video/list?catalogId=".$catalogId."&subCatalogId=1010",'')."<p></p></li>"
           ."<li id='nav6' ".(1011==$subCatalogId?" class='now'":"").">".link_to('热门推荐',"video/list?catalogId=".$catalogId."&subCatalogId=1011",'')."<p></p></li>";
           ?>
           </ul>
           <div class="write_line"></div>
         </div>
         <!--#视频列表开始-->
         <div class="movie_list">
         <?php
         /*foreach($videos as $video)
         {
            echo "<div class='movie_box'>
            ".link_to("<img src='".$video->getSnapshot_big()."' width='184' height='138' />"
                ,"video/detail?catalogId=".$catalogId."&videoId=".$video->getVideoId(),"target='_blank'")
            ."<h3><a href='#' target='_blank'>".$video->getTitle()."</a></h3>
            <p class='movie_tit1'>'".$video->getArtist()."'...</p>
            <p class='movie_tit2'>发布时间　".date('Y/m/d',strtotime($video->getPublish_time()))."</p>
            <p class='movie_tit3'>片长：<b>".substr($video->getDuration(),0,8)."</b></p>
            </div>";
         }*/


           //$videos = @$pages->getResults();
           foreach($videos as $row=>$video)
           {
               echo "<div class='movie_box'>
               ".link_to("<img src='".$video["snapshot_big"]."' width='184' height='138' />"
                ,"video/detail?catalogId=".$video["catalog_id"]."&videoId=".$video["video_id"],"target='_blank'")
            ."<h3>".link_to($video["title"],"video/detail?catalogId=".$video["catalog_id"]."&videoId=".$video["video_id"],"target='_blank'")."</h3>
            <p class='movie_tit1'>'".$video["artist"]."'...</p>
            <p class='movie_tit2'>发布时间　".date('Y/m/d',strtotime($video["publish_time"]))."</p>
            <p class='movie_tit3'>片长：<b>".substr($video["duration"],0,8)."</b></p>
            </div>";
           }
//           $numPages= $pages->getLastPage();
//           $CurrentPageID=$pages->getPage();
//             if(@$pages->haveToPaginate())
//			{
//				$str=$CurrentPageID-6;
//				$end=$CurrentPageID+5;
//				if($str<0)
//					$str=0;
//				if($end>$numPages)
//					$end=$numPages;
//				echo "<div class='page_list'>";
//				if($CurrentPageID>1)
//					echo link_to("上一页","video/list?catalogId=".$catalogId."&subCatalogId=".$subCatalogId."&currentPage=".($CurrentPageID-1),"");
//				 for($i=$str;$i<$end;$i++)
//				 {
//					if($i==($CurrentPageID-1)){
//					echo "<a class='now02' href='#'>".($i+1)."</a>";}
//					else{
//					    echo link_to(($i+1),"video/list?catalogId=".$catalogId."&subCatalogId=".$subCatalogId."&currentPage=".($i+1),"");
//                    }
//				 }
//				 if($CurrentPageID<$numPages)
//				 echo link_to("下一页","video/list?catalogId=".$catalogId."&subCatalogId=".$subCatalogId."&currentPage=".($CurrentPageID+1),"");
//				 echo "</div>";
//			}
             if($totalPageNumber > 1)
                 echo utility::getPageNavigator($currentPageNumber,$totalPageNumber,10,"pageNumber");
         ?>
           <!--<div class="page_list">上一页 <a class="now02" href="#">1</a><a href="#">2</a><a href="#">3</a><a href="#">4</a><a href="#">5</a> 下一页</div>-->
        </div>
     </div>
     <!--左侧结束 右侧开始-->
     <div class="right">
         <?php
              @include_component('other','advertise');
              @include_component('video','special',array('recordCount'=>'4','catalogId'=>$catalogId ,'keyword'=>'')); //特别推荐
              @include_component('video','hotlink',array('recordCount'=>'10','catalogId'=>$catalogId ,'period'=>'')); //最热视频
            ?>
     </div>
  </div>
